﻿using MediatR;
using SheepStorage.API.Application.Command.BodySizeCommand;
using SheepStorage.API.Application.Command.BuildingManagementCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Service.DataImp;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.BodySizeHandler
{
    public class BodySizeDelHandler : IRequestHandler<BodySizeDelCommand, Results<int>>
    {
        private readonly IBodySizeService service;

        public BodySizeDelHandler(IBodySizeService service)
        {
            this.service = service;
        }
        public async Task<Results<int>> Handle(BodySizeDelCommand request, CancellationToken cancellationToken)
        {
            var list = service.DelBodySize(request.BodySizeId);
            return Results<int>.DataResult(list);
        }
    }
}
